<template>
    <div>
        <el-form :model="childForm" label-width="80px" ref="addstuform"
                 size="mini">
            <el-row type="flex" justify="center">
                <el-col :span="10">
                    <el-form-item label="学生姓名">
                        <el-input size="mini" class="search-input" v-model="childForm.name"
                                  placeholder="必填">


                        </el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row type="flex" justify="center">
                <el-col :span="10">
                    <el-form-item label="选择班级">
                        <el-select @change="" class="search-select" v-model="childForm.cid"
                                   placeholder="请选择班级">
                            <el-option value="" label="全部"></el-option>
                            <el-option
                                v-for="item in gclassList"
                                :key="item.id"
                                :label="item.name"
                                :value="item.id">
                            </el-option>

                        </el-select>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row type="flex" justify="center">
                <el-col :span="10">
                    <el-form-item label="学生性别">
                        <el-select @change="" class="search-select" v-model="childForm.sex"
                                   placeholder="请选择学生性别">
                            <el-option value="" label="全部"></el-option>
                            <el-option
                                v-for="item in gsexList"
                                :key="item.id"
                                :label="item.name"
                                :value="item.id">
                            </el-option>

                        </el-select>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row type="flex" justify="center">
                <el-col :span="10">
                    <el-form-item label="出生日期">
                        <el-date-picker style="width: 220px"
                                        v-model="childForm.birthday"
                                        align="right"
                                        type="date"
                                        value-format="timestamp"
                                        placeholder="出生日期"
                        >
                        </el-date-picker>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row type="flex" justify="center">
                <el-col :span="10">
                    <el-form-item label="手机号码">
                        <el-input size="mini" class="search-input" v-model="childForm.mobile"
                                  placeholder="联系方式"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row type="flex" justify="center">
                <el-col :span="10">
                    <el-form-item label="家庭住址">
                        <el-input size="mini" class="search-input" v-model="childForm.address"
                                  placeholder="家庭住址"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
    </div>
</template>

<script>
    import {mapActions, mapState, mapGetters} from 'vuex'
    import headTop from '@/components/headTop'
    import {addUser, getuserDetail, updateUser} from '@/api/getData'
    import {baseUrl, baseImgPath} from '@/config/env'
    import ElCol from "element-ui/packages/col/src/col";
    import ElRow from "element-ui/packages/row/src/row";
    import ElButton from "../../node_modules/element-ui/packages/button/src/button.vue";
    import ElOption from "../../node_modules/element-ui/packages/select/src/option.vue";
    import ElInput from "../../node_modules/element-ui/packages/input/src/input.vue";

    export default {
        computed: {
            ...mapGetters(['admininfo','gclassList','gsexList'])
        },

        props: {
            operType:{
              type:String,
              default :'add'
            },
            stuid:{
                type:Number,
                defalut:0,
            },
            childForm: {
                type: Object,
            },
            cancelname:{
                type:String,
                default:'取消',
            },
            okname:{
                type:String,
            }
    },
        data() {
            return {
                /* formData:{

                 }*/
            }
        },

        components: {
            ElInput,
            ElOption,
            ElButton,
            ElRow,
            ElCol,
            headTop,
        },
        mounted() {

        },
        watch: {},

        methods: {
            ...mapActions(['getSubjectList', 'getGiftList', 'getPeriod', 'setEmpschool', 'deleteEmpschool', 'fillSchoolEmps', 'getAllSchool']),
            confirm: function () {
                this.childForm.test = true;
                this.$emit('confirm', this.childForm);
            },
            cancel: function () {
                this.$emit('cancel',this.childForm);
            }

        },
        created() {

        }
        ,
    }
</script>

<style lang="less">
    @import '../style/mixin';


</style>
